package com.shunli.cterminal.model.res;

import com.alibaba.fastjson.JSONObject;
import com.examples.core.res.BaseRespVO;
import com.shunli.cterminal.model.dto.PolicyGoodsAndPlatformJsonDTO;
import com.shunli.cterminal.model.dto.PolicyPriceJsonDTO;
import com.shunli.cterminal.model.dto.PolicyTimeJsonDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

import java.io.Serializable;

/**
* <p>
    * 流量策略
    * </p>
*
* @author daodao
* @since 2025-04-25 13:43:15
*/
@Getter
@Schema(name = "SystemTrafficPolicy", description = "流量策略")
public class SystemTrafficPolicyVO extends BaseRespVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "ID")
    private String id;

    @Schema(description = "项目方 01 国学 05 长安")
    private String projectCode;
    @Schema(description = "项目方名称")
    private String projectName;

    @Schema(description = "启用状态")
    private String status;

    @Schema(description = "每日配额")
    private Long dailyQuota;

    @Schema(description = "权重系数")
    private Double weightCoefficient;

    @Schema(description = "时间")
    private String timeJson;
    private PolicyTimeJsonDTO timeJsonDTO;

    @Schema(description = "价格")
    private String priceJson;
    private PolicyPriceJsonDTO priceJsonDTO;

    @Schema(description = "商品")
    private String goodsJson;
    private PolicyGoodsAndPlatformJsonDTO goodsJsonDTO;

    @Schema(description = "媒体")
    private String platformJson;
    private PolicyGoodsAndPlatformJsonDTO platformJsonDTO;

    @Schema(description = "备注")
    private String remark;

    public void setId(String id) {
        this.id = id;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void setDailyQuota(Long dailyQuota) {
        this.dailyQuota = dailyQuota;
    }

    public void setWeightCoefficient(Double weightCoefficient) {
        this.weightCoefficient = weightCoefficient;
    }

    public void setTimeJson(String timeJson) {
        this.timeJson = timeJson;
        this.timeJsonDTO = JSONObject.parseObject(timeJson, PolicyTimeJsonDTO.class);
    }

    public void setPriceJson(String priceJson) {
        this.priceJson = priceJson;
        this.priceJsonDTO = JSONObject.parseObject(priceJson, PolicyPriceJsonDTO.class);
    }

    public void setGoodsJson(String goodsJson) {
        this.goodsJson = goodsJson;
        this.goodsJsonDTO = JSONObject.parseObject(goodsJson, PolicyGoodsAndPlatformJsonDTO.class);
    }

    public void setPlatformJson(String platformJson) {
        this.platformJson = platformJson;
        this.platformJsonDTO = JSONObject.parseObject(platformJson, PolicyGoodsAndPlatformJsonDTO.class);
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void setTimeJsonDTO(PolicyTimeJsonDTO timeJsonDTO) {
        this.timeJsonDTO = timeJsonDTO;
    }

    public void setPriceJsonDTO(PolicyPriceJsonDTO priceJsonDTO) {
        this.priceJsonDTO = priceJsonDTO;
    }

    public void setGoodsJsonDTO(PolicyGoodsAndPlatformJsonDTO goodsJsonDTO) {
        this.goodsJsonDTO = goodsJsonDTO;
    }

    public void setPlatformJsonDTO(PolicyGoodsAndPlatformJsonDTO platformJsonDTO) {
        this.platformJsonDTO = platformJsonDTO;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }
}
